#pragma once
#include <QtConcurrent/QtConcurrent>

//==============================================================================
template< typename T > class QAsyncLoader : public QFutureWatcher< T >
{
public:
	QAsyncLoader( QObject * parent = 0 ) :  QFutureWatcher< T >( parent )
	{
		setObjectName( "loader" );
	}
	
	template< class ClassT > inline
	void run( ClassT * object , T ( ClassT::*loader )( ) )
	{
		setFuture( QtConcurrent::run( object , loader ) );
	}
};
